//
//  ZHBaseViewController.m
//  DelightTrip
//
//  Created by dllo on 16/5/11.
//  Copyright © 2016年 Northeast Dianli University. All rights reserved.
//

#import "ZHBaseViewController.h"
#import "JXLDayAndNightMode.h"
#import <MBProgressHUD/MBProgressHUD.h>
#import "DYJUserViewController.h"
#import "Masonry.h"
#import "AudioPlayerManager.h"
#import "ZHNetworkHandler.h"

@class AppDelegate;
@interface ZHBaseViewController ()
// 音乐播放器
@property (nonatomic, strong) AudioPlayerManager *playerManager;

@end

@implementation ZHBaseViewController{
    MBProgressHUD *HUD;
    BOOL isShow;
}


- (void)viewDidLoad {
    [super viewDidLoad];
    
    isShow = NO;
}

#pragma mark 我的界面
- (void)didClickedRightFirstButton:(UIButton *)sender {
    DYJUserViewController *uvc = [[DYJUserViewController alloc] init];
    [self.navigationController pushViewController:uvc animated:YES];
    NSLog(@"我的");
}

#pragma mark 音乐界面
- (void)didClickedRightSecondButton:(UIButton *)sender {
   [self.delegate createMusicPlayView];
}
-(void)createTitle:(NSString *)title {
    UILabel *label = [[UILabel alloc]init];
    label.frame = CGRectMake(150, -10, 55, 30);
    label.text = title;
    label.font = [UIFont systemFontOfSize:18];
    label.textColor = [UIColor colorWithRed:0.23 green:0.22 blue:0.22 alpha:1.00];
    label.textAlignment = NSTextAlignmentCenter;
    self.navigationItem.titleView = label;
}

- (void)createNavigationBarButtonWithPicture:(NSString *)firstPicName
                                     Picture:(NSString *)secondPicName {
    _rightFirst = [UIButton buttonWithType:UIButtonTypeCustom];
    _rightFirst.frame = CGRectMake(ScreenWidth - 45, 4, 32, 32);
    [_rightFirst setBackgroundImage:[UIImage imageNamed:firstPicName] forState:UIControlStateNormal];
    [_rightFirst addTarget:self action:@selector(didClickedRightFirstButton:) forControlEvents:UIControlEventTouchUpInside];
    [_rightFirst setTag:1260];
    [self.navigationController.navigationBar addSubview:_rightFirst];
    
    _rightSecond = [UIButton buttonWithType:UIButtonTypeCustom];
    [_rightSecond setBackgroundImage:[UIImage imageNamed:secondPicName] forState:UIControlStateNormal];
    _rightSecond.frame = CGRectMake(ScreenWidth - 48
                                   - 36, 5, 32, 32);
    [_rightSecond addTarget:self action:@selector(didClickedRightSecondButton:) forControlEvents:UIControlEventTouchUpInside];
    [_rightSecond setTag:1261];
    [self.navigationController.navigationBar addSubview:_rightSecond];
    
}






- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}



/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
